home *** CD-ROM | disk | FTP | other *** search
/ Backpacker 1 (Norsk) / backpacker.iso / pc / data / misc / go_all.dxr / 00001_J - The Question Handler Object.ls next >
Encoding:
Text File  |  1995-02-28  |  19.3 KB  |  660 lines

  1. on birth me
  2.   return me
  3. end
  4.  
  5. on FixAnsChan me
  6.   global K1, K2, K3, K4, K5, RCLK
  7.   set K1 to 1
  8.   set K2 to 2
  9.   set K3 to 3
  10.   set K4 to 4
  11.   set K5 to 5
  12.   set RCLK to K1 + 10
  13. end
  14.  
  15. on AltQ me
  16.   global K1, K2, K3, K4, K5, JOBNAME, QN_D, TWNS, YY, MM, DD, ACTION, CASH, EXCF, SNAME, UNAME, CURR_S, J
  17.   puppetSprite(6, 1)
  18.   puppetSprite(7, 1)
  19.   puppetSprite(8, 1)
  20.   puppetSprite(9, 1)
  21.   puppetSprite(10, 1)
  22.   set the castNum of sprite (K1 + 5) to 9
  23.   set the castNum of sprite (K2 + 5) to 10
  24.   set the castNum of sprite (K3 + 5) to 11
  25.   set the castNum of sprite (K4 + 5) to 12
  26.   set the castNum of sprite (K5 + 5) to 13
  27.   if getLast(ACTION) contains "K" then
  28.     set the text of field "Employer" to JOBNAME && "-" && getAt(QN_D, getLast(TWNS))
  29.     set the text of field "Date" to ReturnDate(me, YY, MM, DD)
  30.     set R to getAt(CURR_S, getLast(TWNS))
  31.     set MC to integer(Infla(me, CASH / EXCF))
  32.     set the text of field "Money" to string(MC) && R
  33.     set the text of field "Name" to SNAME && UNAME
  34.   end if
  35.   when keyDown then if the commandDown then SoundLevelAdjust(J)
  36.   sound fadeOut 1, 100
  37. end
  38.  
  39. on WriteQ me, TT
  40.   global JOBNAME, QN_D, TWNS, YY, MM, DD, ACTION, CASH, EXCF, SNAME, UNAME, TEXTANS, CURR_S
  41.   if getLast(ACTION) contains "K" then
  42.     set the text of field "Employer" to JOBNAME && "-" && getAt(QN_D, getLast(TWNS))
  43.     set the text of field "Date" to ReturnDate(me, YY, MM, DD)
  44.     set R to getAt(CURR_S, getLast(TWNS))
  45.     set MC to integer(Infla(me, CASH / EXCF))
  46.     set the text of field "Money" to string(MC) && R
  47.     set the text of field "Name" to SNAME && UNAME
  48.   end if
  49.   repeat with laba = 1 to 15
  50.     if the name of cast laba contains "Textsvar," then
  51.       set TT to the text of cast laba
  52.     end if
  53.   end repeat
  54.   set TEXTANS to TT
  55.   set the text of field "AnswerText" to "Skriv inn svaret ditt her"
  56.   hilite field "AnswerText"
  57.   sound fadeOut 1, 100
  58. end
  59.  
  60. on NextQInit me
  61.   global TMQS, LQP, PPNM, PNM, TWNS, LMXQ, LQNO, LQDS, PSND, ACTION, KTQR, KTQW, KTKM, PLAYER, MAXPSNDS, J
  62.   set DR to getLast(ACTION)
  63.   delete char 1 of DR
  64.   set DR to value(DR)
  65.   if getLast(ACTION) contains "D" then
  66.     if LQP = count(TMQS) then
  67.       set PPNM to the pathName & getLast(ACTION) & "Q0"
  68.     else
  69.       set LQP to LQP + 1
  70.       set MVN to getAt(TMQS, LQP)
  71.       set PPNM to the pathName & getLast(ACTION) & "Q" & MVN
  72.       FixAnsChan(me)
  73.     end if
  74.   else
  75.     if getLast(ACTION) contains "K" then
  76.       set KTKM to 100 * (KTQR + 0.0) / (KTQR + KTQW)
  77.       if LQP = count(TMQS) then
  78.         set PPNM to the pathName & getLast(ACTION) & "Q0"
  79.       else
  80.         set LQP to LQP + 1
  81.         set MVN to getAt(TMQS, LQP)
  82.         set PPNM to the pathName & getLast(ACTION) & "Q" & MVN
  83.         FixAnsChan(me)
  84.       end if
  85.     end if
  86.   end if
  87.   when keyDown then if the commandDown then SoundLevelAdjust(J)
  88. end
  89.  
  90. on OpenMovieMethod me
  91.   global RANS, PPNM, PNM, LMXQ, LQDS, CHN, TWNS, LQNO, PLAYER, SNAME, SEX, DTQR, DTQW, ACTION, CASH, LIVC, QPAY, PSND
  92.   when keyDown then nothing
  93.   sound stop CHN
  94.   if getLast(ACTION) contains "K" then
  95.     set QPAY to 0
  96.   end if
  97.   if the movie contains "Q0" then
  98.     if getLast(ACTION) contains "K" then
  99.       if PLAYER then
  100.         puppetSound(PSND)
  101.         updateStage()
  102.       end if
  103.       go("LastQuest", the pathName & getLast(ACTION) & "FIX")
  104.     else
  105.       go(the frame + 1)
  106.       if PLAYER then
  107.         puppetSound(PSND)
  108.         updateStage()
  109.       end if
  110.       go(1, FixPath(me, PNM & "MISC:GO_ALL"))
  111.     end if
  112.   else
  113.     if PLAYER then
  114.       puppetSound(PSND)
  115.       updateStage()
  116.     end if
  117.     go(1, PPNM)
  118.   end if
  119. end
  120.  
  121. on AltAnsw me
  122.   global RCLK
  123.   puppetSprite(6, 0)
  124.   puppetSprite(7, 0)
  125.   puppetSprite(8, 0)
  126.   puppetSprite(9, 0)
  127.   puppetSprite(10, 0)
  128.   set RA to 0
  129.   if the clickOn = RCLK then
  130.     set RA to 1
  131.   end if
  132.   if the clickOn = (RCLK - 5) then
  133.     set RA to 1
  134.   end if
  135.   Answ(me, RA)
  136. end
  137.  
  138. on WriteAnsw me, P, K
  139.   if K contains P then
  140.     set RA to 1
  141.   else
  142.     set RA to 0
  143.   end if
  144.   Answ(me, RA)
  145. end
  146.  
  147. on Answ me, RA
  148.   global WANS, RANS, CASH, DTQW, QPAY, PNM, DTQR, KTQR, ACTION, EXCF, CURR_S, TWNS, KTQW, J
  149.   if RA then
  150.     if getLast(ACTION) contains "K" then
  151.       set a to Infla(me, CASH / EXCF)
  152.       set b to Infla(me, QPAY / EXCF)
  153.       set CASH to CASH + QPAY
  154.       set S to integer(Infla(me, CASH / EXCF))
  155.       set R to getAt(CURR_S, getLast(TWNS))
  156.       set KTQR to KTQR + 1
  157.       set P to b / 30
  158.       puppetSound("Cash1")
  159.       updateStage()
  160.       set T to the ticks + 70
  161.       repeat while T > the ticks
  162.         set a to a + P
  163.         set the text of field "Money" to string(integer(a)) && R
  164.         WaitH(me, 2)
  165.       end repeat
  166.       set the text of field "Money" to string(S) && R
  167.       puppetSound(0)
  168.       delay(60)
  169.     else
  170.       if getLast(ACTION) contains "D" then
  171.         set DTQR to DTQR + 1
  172.       end if
  173.     end if
  174.     sound playFile 1, FixPath(me, PNM & "SNDS:ALARMS:POS" & string(random(2)) & ".AIF")
  175.     go("R")
  176.     set RANS to RANS + 1
  177.   else
  178.     if not RA then
  179.       sound playFile 1, FixPath(me, PNM & "SNDS:ALARMS:NEG" & string(random(4)) & ".AIF")
  180.       if getLast(ACTION) contains "K" then
  181.         set KTQW to KTQW + 1
  182.       else
  183.         if getLast(ACTION) contains "D" then
  184.           set DTQW to DTQW + 1
  185.         end if
  186.       end if
  187.       set WANS to WANS + 1
  188.       go("W")
  189.     end if
  190.   end if
  191.   when keyDown then if the commandDown then SoundLevelAdjust(J)
  192.   if not (the movie contains "Q0") then
  193.     NextQInit(me)
  194.   end if
  195. end
  196.  
  197. on DestFastClickGraduate me
  198.   global DTQR, DTQW, L_RANS, RANS, WANS
  199.   set DTQR to DTQR + L_RANS
  200.   set DTQW to DTQW + 13 - L_RANS
  201.   set RANS to RANS + L_RANS
  202.   set WANS to WANS + 13 - L_RANS
  203. end
  204.  
  205. on DayPay me
  206.   global LIVC, CURR_S, CASH, PNM, TWNS, EXCF
  207.   set h to (3.0 * LIVC / 4) + random(1.0 * LIVC / 4)
  208.   set a to Infla(me, CASH / EXCF)
  209.   set b to Infla(me, h / EXCF)
  210.   set S to integer(a - b)
  211.   if S < 0 then
  212.     set S to 0
  213.   end if
  214.   set R to getAt(CURR_S, getLast(TWNS))
  215.   set P to b / 30
  216.   set c to 0
  217.   set m to "Dagens kostnader:" & RETURN
  218.   set the text of field "DayCost" to m & string(integer(b)) && R
  219.   set CASH to CASH - h
  220.   puppetSound(0)
  221.   puppetSound("Cash2")
  222.   updateStage()
  223.   set T to the ticks + 60
  224.   repeat while T > the ticks
  225.     set a to a - P
  226.     set the text of field "Money" to string(integer(a)) && R
  227.     WaitH(me, 2)
  228.   end repeat
  229.   set the text of field "Money" to string(S) && R
  230.   set the text of field "DayCost" to m & string(integer(b)) && R
  231.   NewDate(me)
  232.   WaitH(me, 60)
  233.   if CASH < 0 then
  234.     when timeOut then nothing
  235.     set CASH to 0
  236.     go(100)
  237.     go("Black", FixPath(me, PNM & "SQ_DIR:BLACK"))
  238.     abort()
  239.   end if
  240. end
  241.  
  242. on QuestSalery me
  243.   global CURR_S, PNM, EXCF, CashInit, init, TWNS, KARM, DAYS, CASH, YY, MM, DD, PAY, QPAY, SNAME, UNAME, RANS, WANS
  244.   sound playFile 1, FixPath(me, PNM & "SNDS:ALARMS:BELL" & random(3) & ".AIF")
  245.   set R to getAt(CURR_S, getLast(TWNS))
  246.   set KARM to integer((100.0 * RANS / (RANS + WANS)) + 0.5)
  247.   if DAYS > 20 then
  248.     set gA to 2.33329999999999993 - (0.0133 * KARM)
  249.   else
  250.     set gA to 1.39999999999999991
  251.   end if
  252.   set QPAY to integer((gA * PAY) - (gA * PAY / 10.0) + (2 * random(gA * PAY / 10.0)))
  253.   set P to integer(Infla(me, QPAY / EXCF))
  254.   set the text of field "Pay" to "Denne oppgaven gir:" & RETURN & P && R
  255. end
  256.  
  257. on QuitJob me
  258.   global ACTION, PNM
  259.   go(1, FixPath(me, PNM & "MISC:GO_ALL"))
  260. end
  261.  
  262. on UpdateQ_Array me
  263.   global LMXQ, LQP, TMQS
  264.   repeat with P = LQP to LMXQ
  265.     setAt(TMQS, P, getAt(TMQS, P + 1))
  266.   end repeat
  267.   set LMXQ to LMXQ - 1
  268. end
  269.  
  270. on Infla me, P
  271.   global YY
  272.   if YY > 1995 then
  273.     repeat with n = 1 to YY - 1995
  274.       set P to 104 * P / 100
  275.     end repeat
  276.   end if
  277.   return P
  278. end
  279.  
  280. on Defla me, P
  281.   global YY
  282.   if YY > 1995 then
  283.     repeat with n = YY - 1995 down to 1
  284.       set P to 100.0 * P / 104.0
  285.     end repeat
  286.   end if
  287.   return integer(P)
  288. end
  289.  
  290. on NewDate me
  291.   global YY, MM, DD, DAYS
  292.   set DAYS to DAYS + 1
  293.   set DD to DD + 1
  294.   if DD > 31 then
  295.     set MM to MM + 1
  296.     set DD to 1
  297.     if MM > 12 then
  298.       set MM to 1
  299.       set YY to YY + 1
  300.     end if
  301.   else
  302.     if (MM = 2) or (MM = 4) or ((MM = 6) or (MM = 9)) or (MM = 11) then
  303.       if (DD > 30) or ((MM = 2) and (DD > 28)) then
  304.         set MM to MM + 1
  305.         set DD to 1
  306.       end if
  307.     end if
  308.   end if
  309. end
  310.  
  311. on PutDate me, Y, m, D
  312.   set Y to Y * 10000
  313.   set m to m * 100
  314.   return Y + m + D
  315. end
  316.  
  317. on GetDate me, YMD
  318.   set Y to YMD / 10000
  319.   set m to (YMD / 100) - (Y * 100)
  320.   set D to YMD mod 100
  321.   return ReturnDate(me, Y, m, D)
  322. end
  323.  
  324. on ReturnDate me, Y, m, D
  325.   if m = 1 then
  326.     set K to "januar"
  327.   else
  328.     if m = 2 then
  329.       set K to "februar"
  330.     else
  331.       if m = 3 then
  332.         set K to "mars"
  333.       else
  334.         if m = 4 then
  335.           set K to "april"
  336.         else
  337.           if m = 5 then
  338.             set K to "mai"
  339.           else
  340.             if m = 6 then
  341.               set K to "juni"
  342.             else
  343.               if m = 7 then
  344.                 set K to "juli"
  345.               else
  346.                 if m = 8 then
  347.                   set K to "august"
  348.                 else
  349.                   if m = 9 then
  350.                     set K to "september"
  351.                   else
  352.                     if m = 10 then
  353.                       set K to "oktober"
  354.                     else
  355.                       if m = 11 then
  356.                         set K to "november"
  357.                       else
  358.                         if m = 12 then
  359.                           set K to "desember"
  360.                         end if
  361.                       end if
  362.                     end if
  363.                   end if
  364.                 end if
  365.               end if
  366.             end if
  367.           end if
  368.         end if
  369.       end if
  370.     end if
  371.   end if
  372.   return string(D) && K && string(Y)
  373. end
  374.  
  375. on TimeOutFix me
  376.   set the timeoutKeyDown to 0
  377.   set the timeoutMouse to 0
  378.   set the timeoutPlay to 0
  379.   startTimer()
  380. end
  381.  
  382. on UpdateLatestQ_Dir me, D, LQDS
  383.   repeat with n = 15 down to 1
  384.     setAt(LQDS, n + 1, getAt(LQDS, n))
  385.   end repeat
  386.   setAt(LQDS, 1, D)
  387. end
  388.  
  389. on BeginH me
  390.   global TWNS, QN_D, SNAME, UNAME, JOBNAME, SEX, PLAYER, PSND, PNM, MAXPSNDS, J, YY, MM, DD, CURR_S, CASH, EXCF, LQP, LQNO, LMXQ, PPNM, ACTION, PSND_NUM
  391.   Q_TimeOutFix()
  392.   when keyDown then if the commandDown then SoundLevelAdjust(J)
  393.   set T to JOBNAME && "-" && getAt(QN_D, getLast(TWNS))
  394.   set the text of field "JobNameBig" to T
  395.   set the text of field "Employer" to JOBNAME && "-" && getAt(QN_D, getLast(TWNS))
  396.   set the text of field "Date" to ReturnDate(me, YY, MM, DD)
  397.   set R to getAt(CURR_S, getLast(TWNS))
  398.   set MC to integer(Infla(me, CASH / EXCF))
  399.   set the text of field "Money" to string(MC) && R
  400.   set the text of field "Name" to SNAME && UNAME
  401.   if SEX = 0 then
  402.     set n to "nye"
  403.   else
  404.     set n to "nye"
  405.   end if
  406.   set T to "Vi ├╕nsker v├Ñr nye medarbeider" & RETURN
  407.   set T to T & UNAME && SNAME & " velkommen!"
  408.   set the text of field "EmployMessage" to T
  409.   go(the frame + 1)
  410.   preLoadCast(900, the number of castMembers)
  411.   if PLAYER then
  412.     set PSND_NUM to the number of cast "SIL_PAUS.AIF"
  413.     set PSND to "PAUS" & string(random(MAXPSNDS)) & ".AIF"
  414.     importFileInto(cast PSND_NUM, FixPath(me, PNM & "SNDS:PAUS:" & PSND))
  415.     preLoadCast(PSND_NUM)
  416.   end if
  417. end
  418.  
  419. on FiredH me
  420.   global SNAME, UNAME, K6, JOBNAME, ACTION, QN_K, JOBS, PLAYER, PNM, PSND, MAXPSNDS, J
  421.   when keyDown then if the commandDown then SoundLevelAdjust(J)
  422.   set K6 to 0
  423.   set K to "Du klarer deg ikke s├ªrlig godt," && UNAME & "."
  424.   set K to K & RETURN & RETURN & "Du er oppsagt!"
  425.   set the text of field "F_Message" to K
  426.   set KK to getAt(QN_K, getLast(JOBS))
  427.   set RR to charToNum(char 1 of KK)
  428.   set RRR to numToChar(RR - 32)
  429.   delete char 1 of KK
  430.   set KK to RRR & KK
  431.   set T to "Arbeidsattest for:" && UNAME && SNAME & RETURN
  432.   set T to T & "Yrke:" && KK & RETURN & RETURN
  433.   set T to T & RETURN & RETURN & RETURN & RETURN
  434.   set T to T & "Arbeidsattest kan ikke gis."
  435.   set the text of field "Q_Message" to T
  436.   set the text of field "Signature" to JOBNAME
  437.   set the text of field "JobName" to JOBNAME
  438.   if PLAYER then
  439.     importFileInto(cast PSND, FixPath(me, PNM & "SNDS:PAUS:SIL_PAUS.AIF"))
  440.     set PSND to "PAUS" & string(random(MAXPSNDS)) & ".AIF"
  441.     importFileInto(cast "SIL_PAUS.AIF", FixPath(me, PNM & "SNDS:PAUS:" & PSND))
  442.     preLoadCast(PSND)
  443.   end if
  444. end
  445.  
  446. on LeaveKatQ me
  447.   global TMQS, TWNS, TWNN, PNM, K6, KTKM, C_KTKM, EXPR, C_EXPR, ACTION, KTQR, KTQW, YY, MM, DD, LPDAY, DAYS, PSND, PLAYER, AUKT_JOBS
  448.   set LPDAY to DAYS
  449.   GraduateH(me)
  450.   if (KTKM >= C_KTKM) and (EXPR >= C_EXPR) then
  451.     set K6 to K6 + 5
  452.     set LASTJOB to getLast(ACTION)
  453.     delete char 1 of LASTJOB
  454.     append(AUKT_JOBS, value(LASTJOB))
  455.   end if
  456.   set K to integer(KTQR + ((KTQW + 0.0) / 3))
  457.   append(ACTION, PutDate(me, YY, MM, DD))
  458.   append(ACTION, -1 * ((10000 * K) + (10 * KTKM) + K6))
  459.   set TMQS to 0
  460.   if PLAYER then
  461.     puppetSound(PSND)
  462.   end if
  463.   updateStage()
  464.   go(1, FixPath(me, PNM & "MISC:GO_ALL"))
  465. end
  466.  
  467. on GraduateH me
  468.   global KTQR, KTQW, KTKM, EXPR, ACTION, C_KTKM, C_EXPR, PNM, J
  469.   when keyDown then if the commandDown then SoundLevelAdjust(J)
  470.   set KTKM to integer(100 * (KTQR + 0.0) / (KTQR + KTQW))
  471.   set EXPR_OLD to 0
  472.   repeat with i = 1 to count(ACTION) - 2
  473.     if getAt(ACTION, i) = getLast(ACTION) then
  474.       set EXPR_OLD to EXPR_OLD + (-1 * getAt(ACTION, i + 2) / 10000)
  475.     end if
  476.   end repeat
  477.   set EXPR to integer(KTQR + (KTQW + (0.0 / 3)) + EXPR_OLD)
  478.   if (KTKM >= C_KTKM) and (EXPR >= C_EXPR) then
  479.     sound stop 1
  480.     sound stop 2
  481.     sound playFile 2, FixPath(me, PNM & "SNDS:ALARMS:FANFAR.AIF")
  482.   end if
  483. end
  484.  
  485. on CreditCardH me
  486.   global CURR_S, TWNS, CASH, EXCF, SNAME, UNAME
  487.   set R to getAt(CURR_S, getLast(TWNS))
  488.   set MC to integer(Infla(me, CASH / EXCF))
  489.   set the text of field "Money" to string(MC) && R
  490.   set the text of field "Name" to SNAME && UNAME
  491. end
  492.  
  493. on EmployLetterH me
  494.   global SNAME, UNAME, KTKM, EXPR, LQNO, QN_K, QN_D, JOBNAME, TWNS, YY, MM, DD, ACTION, C_EXPR, C_KTKM
  495.   set X5 to "Nei"
  496.   set KK to getAt(QN_K, getLast(JOBS))
  497.   if (KTKM < C_KTKM) and (EXPR < C_EXPR) then
  498.     set S to "er enn├Ñ ikke dyktig nok og har dessuten for lite erfaring til ├Ñ klare yrket som" && KK
  499.   else
  500.     if (KTKM < C_KTKM) and (EXPR >= C_EXPR) then
  501.       set S to "er enn├Ñ ikke dyktig nok, men har tilstrekkelig erfaring til ├Ñ klare yrket som" && KK
  502.     else
  503.       if (KTKM >= C_KTKM) and (EXPR < C_EXPR) then
  504.         set S to "synes ├Ñ v├ªre meget dyktig, men har ikke erfaring nok til ├Ñ klare yrket som" && KK
  505.       else
  506.         if (KTKM >= C_KTKM) and (EXPR >= C_EXPR) then
  507.           set S to "er meget dyktig og har tilstrekkelig erfaring innenfor sitt ansvarsomr├Ñde. Det er med glede vi i dag kan autorisere" && UNAME && SNAME && "som" && KK
  508.           set X5 to "Ja"
  509.         end if
  510.       end if
  511.     end if
  512.   end if
  513.   set T to "Arbeidsattest for:" && UNAME && SNAME & RETURN
  514.   set T to T & "Yrke:" && KK & RETURN & RETURN
  515.   set T to T & UNAME && SNAME && "har arbeidet hos oss siden den"
  516.   set T to T && GetDate(me, getAt(ACTION, count(ACTION) - 1)) & ". "
  517.   set T to T & UNAME && S & "."
  518.   set T to T & RETURN & RETURN
  519.   set T to T & "Vurdering dyktighet:" && string(integer(KTKM)) & "%" & RETURN
  520.   set T to T & "Vurdering erfaring:" && string(EXPR) && "poeng" & RETURN
  521.   set T to T & "Autorisert som" && KK & ":" && X5
  522.   set the text of field "Q_Message" to T
  523.   set t2 to JOBNAME & RETURN
  524.   set t2 to t2 & getAt(QN_D, getLast(TWNS)) && ReturnDate(me, YY, MM, DD)
  525.   set the text of field "Signature" to t2
  526.   set the text of field "JobName" to JOBNAME
  527. end
  528.  
  529. on WaitH me, TCK
  530.   set T to the ticks + TCK
  531.   repeat while T > the ticks
  532.   end repeat
  533. end
  534.  
  535. on FixPath me, thePath
  536.   if the machineType = 256 then
  537.     set takeAwaySign to ":"
  538.     set putInSign to "\"
  539.     set T to char 1 to 2 of thePath
  540.     repeat with i = 3 to length(thePath)
  541.       set TT to char i of thePath
  542.       if TT = takeAwaySign then
  543.         set T to T & putInSign
  544.         next repeat
  545.       end if
  546.       set T to T & TT
  547.     end repeat
  548.     set thePath to T
  549.   end if
  550.   return thePath
  551. end
  552.  
  553. on CacheNextFile me, nextFile
  554.   ┬¿()
  555.   nothing()
  556. end
  557.  
  558. on SoundLevelAdjust me
  559.   global PNM, gComputer_CD, gComputer_SL
  560.   if the key = "0" then
  561.     set the soundLevel to 0
  562.   else
  563.     if the key = "1" then
  564.       set the soundLevel to 1
  565.     else
  566.       if the key = "2" then
  567.         set the soundLevel to 2
  568.       else
  569.         if the key = "3" then
  570.           set the soundLevel to 3
  571.         else
  572.           if the key = "4" then
  573.             set the soundLevel to 4
  574.           else
  575.             if the key = "5" then
  576.               set the soundLevel to 5
  577.             else
  578.               if the key = "6" then
  579.                 set the soundLevel to 6
  580.               else
  581.                 if the key = "7" then
  582.                   set the soundLevel to 7
  583.                 else
  584.                   if the key = "W" then
  585.                     set HOTEL to 1
  586.                   else
  587.                     if the key = "E" then
  588.                       set alert_message to "This file is:" & RETURN
  589.                       set alert_message to alert_message & the movie
  590.                       alert(alert_message)
  591.                     else
  592.                       if the key = "Q" then
  593.                         set DL_mess to "Er du sikker p├Ñ at du vil avslutte BackPacker ?" & RETURN & RETURN
  594.                         set DL_mess to DL_mess & "Reisen din vil ikke bli lagret !"
  595.                         if the machineType <> 256 then
  596.                           set x_libbet to "BPXlib.MAC"
  597.                         else
  598.                           set x_libbet to "BPXlib.DLL"
  599.                         end if
  600.                         openXLib(FixPath(me, PNM & "MISC:" & x_libbet))
  601.                         set DL_BOX_OBJ to MISC_X(mnew)
  602.                         DL_BOX_OBJ(mAnswer, DL_mess, EMPTY, "Ja", "Nei")
  603.                         set ans_DL_BOX to the result
  604.                         DL_BOX_OBJ(mdispose)
  605.                         closeXLib(FixPath(me, PNM & "MISC:" & x_libbet))
  606.                         if ans_DL_BOX = "Ja" then
  607.                           set the colorDepth to gComputer_CD
  608.                           set the soundLevel to gComputer_SL
  609.                           go(1, FixPath(me, PNM & "MISC:GO_ALL"))
  610.                         end if
  611.                       end if
  612.                     end if
  613.                   end if
  614.                 end if
  615.               end if
  616.             end if
  617.           end if
  618.         end if
  619.       end if
  620.     end if
  621.   end if
  622. end
  623.  
  624. on CodeMachine me, Message, readnumber
  625.   global CASH, SEX, SNAME, ACTION, DAYS, KARM, UNAME, YY, TRAVEL, PHONE_M
  626.   if SNAME <> EMPTY then
  627.     set ASCII to charToNum(char 1 of SNAME)
  628.   else
  629.     set ASCII to 9
  630.   end if
  631.   if (count(ACTION) < 20) and (CASH < 4000) then
  632.     set codenumber to YY + (length(SNAME) * integer(CASH)) + SEX + integer(KARM) + count(ACTION) - getAt(ACTION, 1) + 129 + ASCII + (3435 * DAYS) - TRAVEL + PHONE_M
  633.   else
  634.     if ((DAYS + count(ACTION)) >= 19) and ((DAYS + count(ACTION)) < 45) then
  635.       set codenumber to length(SNAME) + (integer(CASH) * SEX) + integer(KARM) + count(ACTION) - getAt(ACTION, 3) + 469 - (2 * PHONE_M) - (456 * DAYS) - (24 * TRAVEL)
  636.     else
  637.       if (length(UNAME) + integer(CASH / 1000)) > 10 then
  638.         set codenumber to (DAYS * integer(CASH) * 67) + 9 + count(ACTION) + ASCII + (2 * YY) - integer(KARM) + (TRAVEL * PHONE_M) + integer(KARM)
  639.       else
  640.         if (PHONE_M < 1500) and (CASH > 3000) then
  641.           set codenumber to (DAYS * integer(CASH) * 63) + 9 + count(ACTION) + YY + (19 * integer(KARM)) - (320 * TRAVEL) - PHONE_M
  642.         else
  643.           set codenumber to (DAYS * integer(CASH) * 60) + count(ACTION) + YY + (19 * integer(KARM)) - (302 * TRAVEL) - PHONE_M + 56
  644.         end if
  645.       end if
  646.     end if
  647.   end if
  648.   if Message = "code" then
  649.     return codenumber
  650.   else
  651.     if Message = "decode" then
  652.       if readnumber = codenumber then
  653.         return 1
  654.       else
  655.         return 0
  656.       end if
  657.     end if
  658.   end if
  659. end
  660.